import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './plugins/base'
import './plugins/chartist'
import './plugins/vee-validate'
import vuetify from './plugins/vuetify'
import Global from './components/util/Global.vue'
import VuetifyDialog from 'vuetify-dialog'
import 'vuetify-dialog/dist/vuetify-dialog.css'

Vue.prototype.dataTableFooterProps = Global.dataTableFooterProps;

Vue.use(VuetifyDialog, {
  context: {
    vuetify
  }
})

Vue.prototype.successMsg = function (msg) {
  this.$store.dispatch('snackbar/openSnackbar',{
    msg: msg,
    color: 'success',
    showClose: true,
    timeout: 2000,
  }).then()
}

Vue.prototype.errorMsg = function (msg) {
  this.$store.dispatch('snackbar/openSnackbar',{
    msg: msg,
    color: 'orange darken-3',
    showClose: true,
    timeout: 10000,
  }).then()
}

Vue.config.productionTip = false

new Vue({
  router,
  store,
  vuetify,
  VuetifyDialog,
  render: h => h(App)
}).$mount('#app')
